"""ARM cross compilation toolchains for bazel"""

module(
    name = "toolchains_arm_gnu",
    version = "1.0.4",
    compatibility_level = 1,
)

bazel_dep(name = "platforms", version = "0.0.8")
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "bazel_skylib", version = "1.5.0")

# DEV ONLY (not needed for release)
bazel_dep(name = "aspect_bazel_lib", version = "2.0.0", dev_dependency = True)

arm_toolchain = use_extension(
    "@toolchains_arm_gnu//:extensions.bzl",
    "arm_toolchain",
    dev_dependency = True,
)
arm_toolchain.arm_none_eabi()
use_repo(arm_toolchain, "arm_none_eabi")
arm_toolchain.arm_none_linux_gnueabihf()
use_repo(arm_toolchain, "arm_none_linux_gnueabihf")
arm_toolchain.aarch64_none_elf()
use_repo(arm_toolchain, "aarch64_none_elf")
arm_toolchain.aarch64_none_linux_gnu()
use_repo(arm_toolchain, "aarch64_none_linux_gnu")

register_toolchains(
    "//test/toolchains:all",
    "@aarch64_none_elf//toolchain:all",
    "@aarch64_none_linux_gnu//toolchain:all",
    "@arm_none_eabi//toolchain:all",
    "@arm_none_linux_gnueabihf//toolchain:all",
    dev_dependency = True,
)
